#include "Parser.h"
#include "StatusCode.h"
#include "debugstreams.h"

using namespace std;

int main( int argc, char* argv[] )
{
  string filename("XML/Eldarion.xml");

  if ( argc > 1 )
    filename = string( argv[1] );

  Parser test( filename.c_str() );

  test.setLevel( INFO, 0 );

  StatusCode sc(test.chargerFichier());

  if ( sc )
    {
      blank() << "Fichier lu" << endreq;
      blank() << sc.valeur() << " lignes lues" << endreq;
    }
  else
    blank() << sc.message() << endreq;

  sc = test.lireDocument();

  blank() << endreq;

  map< string, string > infos;

  test.getInformations( infos );

  map< string, string >::const_iterator it, Begin( infos.begin() ),
    End( infos.end() );

  for ( it = Begin; it != End; it++)
    blank() << it -> first << " -> " << it -> second << endreq;

  return 0;
}
